package com.shenzhenai.composebasic.components

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

/**
 * @author huangzehui
 * @date 12/9/2025 下午11:21 周五
 * @description
 *
 * Card 用法
 * https://www.bilibili.com/video/BV1Gi4y127JL?vd_source=e07cc8cc94eb22bd76722071b03cd199&spm_id_from=333.788.videopod.sections
 */


@Composable
fun CardSample() {
    Card(

        colors = CardDefaults.cardColors().copy(
            // Card 的颜色
            containerColor = Color.Red,
            // Card 子视图的颜色
            contentColor = Color.Blue
        ),
        border = BorderStroke(1.dp, Color.Yellow),
        // 设置海报高度（阴影的深度）
        elevation = CardDefaults.cardElevation(
            defaultElevation = 10.dp
        )
    ) {
        Text(text = "Hello World", modifier = Modifier.padding(8.dp),)
    }
}

@Preview
@Composable
fun CardSamplePreView() {
    CardSample()
}